package com.polaris.live.viewmodel.me

import androidx.lifecycle.MutableLiveData
import com.polaris.live.common.mvvm.viewmodel.BaseViewModel
import com.polaris.live.common.network.request
import com.polaris.live.common.network.state.ResultState
import com.polaris.live.common.resp.UserResp
import com.polaris.live.net.userService
import com.polaris.live.resp.back_resp.RichCharmBean
import com.polaris.live.resp.back_resp.UserRichCharmConfigsResp
import com.polaris.live.resp.back_resp.UserScorePartyGameResp

/**
 * RichCharmViewModel
 *
 * @author Created by 长空 on 2023/10/21 16:35
 * @since 1.0.0
 */
class RichCharmViewModel : BaseViewModel() {

    val mRichCharmLiveData = MutableLiveData<ResultState<RichCharmBean>>()
    fun getRichCharmRule() {
        request({ userService.getRichCharm() }, mRichCharmLiveData)
    }

    val mRichCharmV2LiveData = MutableLiveData<ResultState<UserRichCharmConfigsResp>>()
    fun getRichCharmV2() {
        request({ userService.getRichCharmV2() }, mRichCharmV2LiveData)
    }

    val mUserLiveData = MutableLiveData<ResultState<UserResp>>()
    fun getUser() {
        request({ userService.getUserData() }, mUserLiveData)
    }

    val mPartyScoreLiveData = MutableLiveData<ResultState<List<UserScorePartyGameResp>>>()
    fun scorePartyGame() {
        request({ userService.scorePartyGameList() }, mPartyScoreLiveData)
    }

}